Skip to content

fix(core-ts): allow the collection index page at a permalink prefix - #119

Merged
Madraka merged 1 commit into
mainfrom
fix/collection-index-page
Oct 23, 2026
Merged

Madraka merged 1 commit into
mainfrom
fix/collection-index-page

Conversation

@Madraka

@Madraka Madraka commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What

set_collection_permalink with posts → /blog/{slug} failed with path_conflict: collection "posts" at /blog would cover page /blog, although /blog is only the listing page and entries live at /blog/<slug>. RFC-0038 keeps the collection index page a page the owner creates, so a page at a configured prefix is now allowed and only pages strictly under it conflict:

  • checkPermalinks uses pathUnder (was pathWithin, which was also true for equal paths).
  • The SQL race guard on the site CAS is now noPageUnder (was noPageWithin).
  • The reverse check on page writes (checkPagePath, pageGuard → configuredPrefixFree(…, "under")) lets a page sit at the prefix.
  • RFC-0038 invariant 1 and "Overlaps" / "The reverse" say "under", not "at or under".

Once released, cloudhal.com's posts can move to /blog/{slug}. Studio's "Create listing page" now also works for a collection with its own permalink.

Tests: the core-ts permalink suite (sqlite, D1, DO SQLite) gains "the page at a template's prefix is the collection's index page", in both orders (page first, template first), with the SQL guards in the batch. The MCP, API and Studio tests that used a page at the prefix as their conflict now use one under it.

Checklist

  • pnpm check passes locally (see below); cargo test not needed (no contract or Rust change)
  • Contract change? No
  • Changeset added (@cloudhal/core-ts patch)
  • Commits are signed off
  • Docs updated (RFC-0038)

Verified on a local merge of all three gap PRs (fix/collection-index-page, fix/theme-scripts-csp, fix/body-blocks-and-tools; they merge cleanly): Biome, size check, font-fallback and MCP-doc checks, every typecheck, and every package test suite pass, including @cloudhal/cli (45 files, Chrome render tests included). One exception, not from this change: 35 tests in core-ts store.test.ts on the "Durable Object SQLite (Miniflare)" backend fail with connect EADDRNOTAVAIL (local port exhaustion). main fails the same 35 tests on this machine. No Rust or contract change, so cargo test was not run. GitHub Actions runners do not start (billing), so CI red is environmental.

🤖 Generated with Claude Code

set_collection_permalink refused /blog/{slug} while a page lived at
/blog, the collection's listing page. Only pages strictly under a
configured prefix conflict now, in checkPermalinks, its SQL guard
(noPageUnder) and the reverse page-write check (checkPagePath,
configuredPrefixFree "under"). RFC-0038 "Overlaps" and invariant 1
say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka
Madraka merged commit 29e1dd5 into main Oct 23, 2026
4 checks passed
@Madraka
Madraka deleted the fix/collection-index-page branch October 23, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant